<template>
  <div>
    <el-row>
      <el-col :span="4">
        <div style="padding-top:85%">
          <el-button @click="clickCaretRight()" size="mini" type="primary">
            <i class="el-icon-caret-right"></i>
          </el-button>
          <div style="height:20px;"></div>
          <el-button @click="clickCaretLeft()" size="mini" type="primary">
            <i class="el-icon-caret-left"></i>
          </el-button>
        </div>
      </el-col>
      <el-col :offset="2" :span="18">
        <el-button plain round size="small" type="success" @click="submitSelect">确定</el-button>
        <el-table
          :data="tableData"
          @selection-change="rightPartSelectionChange"
          style="width: 100%"
        >
          <!-- 多选框 -->
          <el-table-column type="selection" width="55"></el-table-column>
          <slot></slot>
          <!-- <el-table-column label="名称" prop="roleName"></el-table-column> -->
        </el-table>
      </el-col>
    </el-row>
  </div>
</template>

<script>
export default {
  name: 'RightPartTable',
  props: {
    tableData: Array
  },
  methods: {
    clickCaretRight() {
        this.$emit('clickCaretRight')
    },
    clickCaretLeft() {
        this.$emit('clickCaretLeft')
    },
    rightPartSelectionChange(val){
        this.$emit('rightPartSelectionChange',val)
    },
    submitSelect(){
        this.$emit('submitSelect')
    }
  }
}
</script>

<style lang="scss" scoped>
</style>